* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

.chat-container {
    padding: 20px;
    height: 70vh;
    display: flex;
    flex-direction: column;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 20px;
    background: #fafafa;
}

.message {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 8px;
    max-width: 80%;
}

.user-message {
    background: #007bff;
    color: white;
    margin-left: auto;
}

.ai-message {
    background: white;
    border: 1px solid #ddd;
    white-space: pre-wrap;
    line-height: 1.6;
}

.input-form {
    display: flex;
    gap: 10px;
}

.input-group {
    display: flex;
    width: 100%;
    gap: 10px;
}

textarea {
    flex: 1;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

textarea:focus {
    outline: none;
    border-color: #007bff;
}

button {
    padding: 15px 25px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    min-width: 100px;
}

button:hover:not(:disabled) {
    background: #0056b3;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.typing-indicator {
    color: #666;
    font-style: italic;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 8px;
    margin-bottom: 10px;
}

.model-selector {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.model-selector label {
    font-weight: 600;
    color: #495057;
}

.model-selector select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: white;
    flex: 1;
}

.system-message {
    background: #e3f2fd;
    color: #1565c0;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    border-left: 4px solid #2196f3;
}

@media (max-width: 600px) {
    .input-group {
        flex-direction: column;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .chat-container {
        height: 60vh;
    }
}
